import React, { Component } from 'react'
import Header from '../../components/Header/Header'
import {reqbanner} from '../../request/api'
import { imgPre } from '../../request/http'
import {Swiper} from 'antd-mobile'
export default class Mine extends Component {
  constructor(){
    super()
    this.state={
      banner:[],
    }
  }
  componentDidMount(){
    reqbanner().then(d=>{
     if(d.data.code==200){
      this.setState({
        banner:d.data.list
      })
     }
    })
  }
  render() {
    let {banner}=this.state
    return (
      <div>
        <Header title={'我的'} back></Header>
        {/* <Swiper autoplay>{items}</Swiper> */}
        {/* <div>{JSON.stringify(banner)}</div> */}
        <Swiper autoplay style={{"--height":"4rem"}}>
          {/* <Swiper.Item></Swiper.Item> */}
         {banner.map((item)=>{
          return(
           
               <Swiper.Item key={item.id}>
               <img src={imgPre+item.img} alt="" />
              </Swiper.Item>
          
          )
        })}
      </Swiper>
      </div>
    )
  }
}
